/* eslint-disable no-use-before-define */

declare type long = string

declare type double = string

declare type bigdecimal = string

declare interface ResponseData<T = unknown> {
  code: number
  msg: string
  data: T
  next: string
}

declare interface ResponseDataList<T = unknown> {
  code: number
  msg: string
  data: T[]
  next: string
}

declare interface ResponseList<T = unknown> {
  code: number
  msg: string
  data: T
}

declare interface RespData<T = unknown> {
  code: number
  msg: string
  data: T
}

declare interface ListData<T = unknown> {
  list: T[]
  total: number
  summary: T
}

declare interface RegularData<T = unknown> {
  data: T
}

<% for (const schema of schemasList) { -%>
<% if (schema.description) { -%>

<%- formatter.description(schema.description) -%>
<% } -%>
<% const title = formatter.interfaceName(schema.title) -%>
<% if (schema.type === 'object' && schema.properties) { %>
  declare interface <%- title %> {
  <% for (const key in schema.properties) { -%>
  <% const required = schema.required?.includes(key) -%>
  <%- utils.getResProperty(schemasList, key, schema.properties[key], required) %>
  <% } -%>
  }
<% } else { -%>
  declare type <%- title %> = <%- utils.getResType(schemasList, title, schema) %>
<% } -%>
<% } -%>